home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 June / 1984-06.d64 / 3-d tac toe_64 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1984-01-01  |  4.0 KB  |  123 lines

  1. 1 print"[147]":poke53281,0:poke53280,4
  2. 2 dimdi(28):fori=1to27:readx1:x2=x2+x1:di(i+1)=x2:nexti:di(1)=0
  3. 5 printtab(9)"   [169]      [146]        [223]"
  4. 6 printtab(9)"  [169]        [146]        [223]"
  5. 7 printtab(9)" [169]         [146]         [223]"
  6. 8 printtab(9)"[169]          [146]          [223]"
  7. 9 printtab(9)"           [146]           [223]"
  8. 10 printtab(9)"  [146][169]  [169]     [146]      [146]      "
  9. 11 printtab(9)"    [169]      [146]      [146]      "
  10. 12 printtab(9)"   [169]       [146]      [146]      "
  11. 13 printtab(9)"           [146]      [146]      "
  12. 14 printtab(9)"           [146]      [146]      "
  13. 15 printtab(9)"  [169]        [146]      [146]      "
  14. 16 printtab(9)" [169]        [146][169]            "
  15. 17 printtab(9)"[169]        [146][169]             "
  16. 18 printtab(9)"        [146][169]   [223]          "
  17. 19 printtab(9)"       [146][169]     [223]        [146][169]"
  18. 20 printtab(9)"[223]     [146][169]       [223]      [146][169]"
  19. 25 printtab(9)"[159]t i c [195][195] [159]t a c [195][195][159] t o e"
  20. 30 printtab(12)"[150]firebutton to play"
  21. 35 if(peek(56321)and16)=16and(peek(56320)and16)=16then35
  22. 52 print"[147][153]";:poke53281,0:dimp(27):o=1
  23. 53 ph=54272:cu=32:cc=0:s=54272
  24. 54 pokes+13,240
  25. 55 p(1)=1119:p(2)=1122:p(3)=1125:p(4)=1201:p(5)=1204:p(6)=1207:p(8)=1286
  26. 56 p(7)=1283
  27. 57 p(9)=1289:p(10)=1439:p(11)=1442:p(12)=1445:p(13)=1521:p(14)=1524:p(15)=1527
  28. 58 p(16)=1603:p(17)=1606:p(18)=1609:p(19)=1759:p(20)=1762:p(21)=1765
  29. 59 p(22)=1841:p(23)=1844:p(24)=1847:p(25)=1923:p(26)=1926:p(27)=1929
  30. 60 ford=1to2:print"player #";d;:inputpl$(d):next:co(1)=4:co(2)=5
  31. 61 forv=1to2:pl$(v)=left$(pl$(v),9):next
  32. 63 m(2)=87:m(1)=86:l=1
  33. 65 input"how many rounds";rd
  34. 70 u(1)=56321:u(2)=56320
  35. 90 print"[147]";:forv=1to3
  36. 100 printtab(12)"[164][164][164][164][164][164][164][164][164]"
  37. 110 printtab(12)"[223][146]  [205]  [205]  [205]"
  38. 120 printtab(12)"[223][223][146][164] [205][164] [205][164] [205]"
  39. 130 printtab(13)"[223][223][146][163][163][205][163][163][205][163][163][205]"
  40. 140 printtab(14)"[223][223][146][164] [205][164] [205][164] [205]"
  41. 150 printtab(15)"[223][223][146][163][163][205][163][163][205][163][163][205]"
  42. 160 printtab(16)"[223][223][146]  [205]  [205]  [205]"
  43. 170 printtab(17)"[223]         "
  44. 175 onvgoto176,177,330
  45. 176 print"";:next
  46. 177 print"[158]";:next
  47. 330 r=1
  48. 340 pokep(o),160:pokep(o)+ph,1
  49. 350 print"[158]round:[153]";r;"[153]":printpl$(l);"'s turn";
  50. 351 forv=1to12-len(pl$(l))-2:print" ";:next
  51. 360 j=15-(peek(u(l))and15)
  52. 380 ifj=8thenpp=1:goto410
  53. 390 ifj=4thenpp=-1:goto420
  54. 400 goto459
  55. 410 ifo=27theno=26:nx=cu:nc=cc:goto433
  56. 415 nx=peek(p(o+1)):nc=peek(p(o+1)+ph):goto430
  57. 420 ifo=1theno=2:nx=cu:nc=cc:goto433
  58. 425 nx=peek(p(o-1)):nc=peek(p(o-1)+ph)
  59. 430 pokep(o),cu:pokep(o)+ph,cc
  60. 433 o=o+pp
  61. 435 cu=nx:cc=nc
  62. 440 pokep(o),160:pokep(o)+ph,1
  63. 441 pokes+11,17:pokes+8,70:pokes+24,15
  64. 442 ford=1to20:next:pokes+24,0:pokes+11,16:goto460
  65. 459 ford=1to15:next
  66. 460 pokep(o),cu:pokep(o)+ph,cc:ford=1to45:next:pokep(o),160:pokep(o)+ph,1
  67. 470 j=peek(u(l))and16:ifj=16then360
  68. 475 ifcu=32then480
  69. 476 pokes+11,17:pokes+8,14:pokes+24,15
  70. 477 ford=1to500:next:pokes+24,0:pokes+11,16:goto360
  71. 480 pokep(o),m(l):pokep(o)+ph,co(l):cu=m(l):cc=co(l)
  72. 481 pokes+11,17:pokes+8,200:pokes+24,15
  73. 482 ford=1to250:next:pokes+11,16:pokes+24,0
  74. 485 a=0:b=0:c=0
  75. 490 restore:readx:for i=1todi(o)+13:readx,y:nexti
  76. 495 fori=di(o)+1todi(o+1)
  77. 500 read x,y:if(peek(p(x))=m(l))and(peek(p(y))=m(l))then b=x:c=y:a=o
  78. 510 nexti
  79. 740 ifa=0then923
  80. 745 print"";pl$(l);" wins!";
  81. 746 forv=1to12-len(pl$(l))-2:print" ";:next
  82. 747 sc(l)=sc(l)+1
  83. 750 t=255:pokes+11,17:pokes+24,15:forx=1to10
  84. 760 h=int(16*rnd(1))
  85. 770 pokep(a)+ph,h
  86. 780 pokep(b)+ph,h
  87. 790 pokep(c)+ph,h
  88. 800 pokes+8,t:ford=1to350:next:t=t-26:next:pokes+11,16:pokes+24,0:goto920
  89. 920 foro=1to27:pokep(o),32:pokep(o)+ph,0:next
  90. 923 ifl=1thenl=2:goto930
  91. 925 l=1
  92. 930 ifa=0then350
  93. 940 cu=32:cc=0:nx=0:nc=0:o=1
  94. 945 r=r+1:ifr>rdthen950
  95. 946 goto350
  96. 950 print"[147]                 "
  97. 955 print"final score"
  98. 957 print"[158][183][183][183][183][183][183][183][183][183][183][183]"
  99. 960 print""pl$(1);":";sc(1)
  100. 970 print""pl$(2);":";sc(2)
  101. 980 print"[150]firebutton to play again"
  102. 990 if(peek(u(1))and16)=16thenif(peek(u(2))and16)=16then990
  103. 1000 poke198,0:run
  104. 1080 data 7,4,7,4,5,4,7,4,7,4,5,4,5,12,5,4,5,4,7,4,7,4,5,4,7,4,7
  105. 1100 data 2,3,4,7,5,9,10,19,13,25,11,21,14,27,1,3,5,8,11,20
  106. 1105 data 14,26,2,1,6,9,5,7,12,21,15,27,14,25,11,19,5,6
  107. 1110 data 14,24,13,22,1,7,1,9,2,8,3,7,4,6,14,23,15,24
  108. 1115 data 3,9,14,22,4,5,1,4,3,5,8,9,16,25,13,19,17,27,14,21
  109. 1120 data 7,9,2,5,17,26,14,20,1,5,3,6,7,8,18,27,15,21,17,25,14,19
  110. 1125 data 11,12,13,16,14,18,1,19,10,12,14,17,2,20,3,19,1,21
  111. 1130 data 14,16,15,18,10,11,3,21,10,16,14,15
  112. 1135 data 4,22,1,25,7,19,10,18,11,17,12,16,13,15,2,26
  113. 1140 data 1,27,3,25,4,24,6,22,7,21,8,20,9,19,12,18
  114. 1145 data 13,14,6,24,3,27,9,21,10,13,18,17,12,14,7,25
  115. 1150 data 11,14,16,18,8,26,9,25,7,27,12,15,10,14,16,17
  116. 1155 data 9,27,20,21,22,25,23,27,1,10,9,14,7,13,3,11
  117. 1160 data 23,26,2,11,8,14,19,21,19,20,27,24,23,25
  118. 1165 data 12,3,9,15,7,14,1,11,19,25,23,24,4,13,6,14
  119. 1170 data 19,27,20,26,21,25,22,24,5,14,22,23,21,27
  120. 1175 data 6,15,4,14,23,21,26,27,19,22,7,16,1,13,9,17
  121. 1180 data 3,14,20,23,25,27,8,17,2,14,19,23,21,24,25,26
  122. 1185 data 9,18,3,15,7,17,1,14
  123.